import request from '@/utils/request'
export default {

  getList() {
    return request({
      url: '/admin/edu/teacher/list',
      method: 'GET'
    })
  },
  getPage(pageNum, pageSize, searchObj) {
    return request({
      url: `/admin/edu/teacher/pageList/${pageNum}/${pageSize}`,
      method: 'Get',
      params: searchObj // 搜索条件为一个Json对象
    })
  },
  // 3、删除讲师api
  deleteById(id) {
    return request({
      url: `/admin/edu/teacher/deleteById/${id}`,
      method: 'DELETE'
    })
  },
  // 4.批量删除讲师api
  batchDel(ids) {
    return request({
      url: `/admin/edu/teacher/batchDel`,
      method: 'DELETE',
      data: ids
    })
  },
  // 5.新增讲师
  save(teacher) {
    return request({
      url: `/admin/edu/teacher/save`,
      method: 'POST',
      data: teacher
    })
  },
  // 6.根据ID查询讲师信息
  getById(id) {
    return request({
      url: `/admin/edu/teacher/getById/${id}`,
      // `/admin/edu/teacher/getById/${id}`
      method: 'GET'
    })
  },
  // 7.修改讲师
  updateById(teacher) {
    return request({
      url: `/admin/edu/teacher/updateById`,
      method: 'PUT',
      data: teacher
    })
  }

}

